
export function setStorage(key:string,value:any){
    let res = {
        timeStamp:+new Date(),
        data:value
    }
    localStorage.setItem(key,JSON.stringify(res))
}

export function getStorage(key:string){
    try {
        if (localStorage.getItem(key)){
            return JSON.parse(localStorage.getItem(key)+'').data
        }
    }catch (e) {
        throw new Error("获取"+key+"失败")
    }
}
